﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

namespace System
{
    public class SQL2005Dal<T>: BaseDAL<T> where T : BaseModel, new()
    {
        public override DBType DBType
        {
            get
            {
                return DBType.Sql2005;
            }

        }
        public  SQL2005Dal()
        {  }

        public  SQL2005Dal(string configName)
            : base(configName)
        {  }

        protected override List<DBParameter> InitDataParameter(List<DBParameter> parameters, int? pageIndex, int? pageSize)
        {
            if (parameters == null)
                parameters = new List<DBParameter>();

            DBParameter top = new DBParameter();
            top.DbType = DbType.Int32;
            top.ParameterName = "pageIndex";
            top.Value = pageIndex;
            parameters.Add(top);

            DBParameter size = new DBParameter();
            size.DbType = DbType.Int32;
            size.ParameterName = "pageSize";
            size.Value = pageSize;
            parameters.Add(size);

            return parameters;
        }
    }
}
